const EventEmitter = require('events');
const util = require('util');

function MyEmitter() {
    EventEmitter.call(this);
}
util.inherits(MyEmitter, EventEmitter);

const myEmitter = new MyEmitter();
myEmitter.once('event', () => {
    console.log('Emitted');
});
myEmitter.emit('event');
myEmitter.emit('event');
